package demo.practice.dp;

public class P739 {

    public int[] dailyTemperatures(int[] temperatures) {

        int[] res = new int[temperatures.length];
        for (int i = 0; i < temperatures.length; i++) {
            for (int j = i + 1; j < temperatures.length; j++) {
                if(temperatures[j]>temperatures[i]){
                    res[i]= j-i;
                    break;
                }
            }
        }
        temperatures[temperatures.length-1]=0;


        return res;
    }

}
